Analysis notebook guidelines¶
Jupyter notebooks can be a very useful tool for data analysis and measurement logging. Some of the main benefits are
Direct access to data and analysis code. The analysis is therefore reproducible.
Conversion of analysis notebooks into a website (ask Serwan for details).
Can be combined with version control, allowing tracking of changes.
For everyone using SilQ/QCoDeS, the first point is especially true. Although Jupyter Notebook has several advantages when used as an analysis/logging tool, difficulties can arise. Speaking from personal experiences, the main struggle was how to organize the Jupyter Notebooks. There is a fine balance between having too many notebooks, and having too few notebooks that explode in size. Below we describe guidelines that we have found gave us good results. An added benefit of this structure is that it can be straightforwardly converted to a website.
Structure of an analysis notebook¶
Part 0. Initialization cell¶
Each analysis notebook typically starts with a single initialization cell containing some code that loads all of the necessary packages/scripts
Part 1. Summary¶
Part 2. Measurements¶
Hierarchical structuring of measurements¶
**<span style="color:forestgreen">Success</span>**
- **<span style="color:red">fail</span>**
# Guidelines for analysis notebooks
Try to avoid multiple copies of analysis blocks, especially if it’s long. Instead, create a function and place it in a script folder.
When creating a subsection, always use one level lower (i.e. not straight from header to subsubheader)
For the summary, try to create a storyline. Things don’t necessarily have to be explained chronologically.
When the notebook is finished, ensure that it can run from start to finish by pressing Kernel -> Restart and run all
Do not write code cells that only output values. For example. if you want to output a frequency from a fit, perform a
print
statement with some text explaining what is being output (and units!)To create a hyperlink, first add an HTML tag at the destination markup cell (typically a header).
The HTML anchor tag must be written as:
<a id='your_tag_here'></a>
To create a hyperlink in a markdown cell, simply include “
[text with hyperlink](#your_tag_here)
”, with result: text with hyperlink.